﻿using Anley.DomainDrivenDesign.Contract.DependencyInjection;

namespace Anley.DomainDrivenDesign.Contract.Helper;

/// <summary>
/// 文件帮助接口
/// </summary>
public interface IFileHelper
    : IScopedAutoInject
{
    /// <summary>
    /// 生成本地路径
    /// </summary>
    /// <param name="pathes"></param>
    string GenerateLocalPath(
        params string[] pathes);

    /// <summary>
    /// Dapper保存至Excel
    /// </summary>
    /// <param name="connection"></param>
    /// <param name="queryString"></param>
    /// <param name="filePath"></param>
    Task DapperToExcelAsync(
        IDbConnection connection,
        string queryString,
        string filePath);

    /// <summary>
    /// 数据源保存至Word
    /// </summary>
    /// <param name="source"></param>
    /// <param name="templatePath"></param>
    /// <param name="filePath"></param>
    void DataSourceToWord(
        IMailMergeDataSource source,
        string templatePath,
        string filePath);

    /// <summary>
    /// 数据源保存至PDF
    /// </summary>
    /// <param name="source"></param>
    /// <param name="wordTemplatePath"></param>
    /// <param name="filePath"></param>
    void DataSourceToPdf(
        IMailMergeDataSource source,
        string wordTemplatePath,
        string filePath);
}